package user.servlet;

import util.RLUtils;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/ChePhoneServlet")
public class ChePhoneServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取用户输入的验证码
        String userCode=request.getParameter("code");
//        String codeStr =;
        //从session中取出验证码


        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out=response.getWriter();
        if(request.getSession().getAttribute("codeStr").equals(userCode)){
            out.print(true);
        }else{
            out.print(false);
        }
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
